package net.zjitc.lib;

public class Test extends Thread  {
    int sleepTime;
    public Test(String id){
        super(id);
        sleepTime= (int) (Math.random()*100);
        System.out.println("Thread:"+getName()+","+"sleeptime:"+sleepTime);
    }
    @Override
    public void run() {
        try {
            Thread.sleep(sleepTime);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("The Running Thread"+getName());
    }

    public static void main(String[] args) {

        Test thread1= new Test("Thread1");
        Test thread2= new Test("Thread2");
        Test thread3= new Test("Thread3");
        Test thread4= new Test("Thread4");
        thread1.start();
        thread2.start();
        thread3.start();
        thread4.start();

    }
}
